﻿
@{
    ViewBag.Title = "EmployeePageList";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css{
    <link rel="stylesheet" href="~/assets/portal/assets/css/common.css" />
    <link rel="stylesheet" href="~/bussiness/js/base/reset.css" />
    <style>

        .title {
            display: flex;
            align-items: center;
            position: relative;
            padding-left: 10px;
            box-sizing: border-box;
            margin: 16px 0;
            font-size: 16px;
        }

            .title::after {
                position: absolute;
                left: 0px;
                content: "";
                display: inline-block;
                width: 3px;
                height: 16px;
                background: #0064e5;
            }
    </style>
}
<div id="PPEEquipmentPickup" class="font-['SourceHanSansSC']">
    <a-style-provider hash-priority="high">
        <a-config-provider :locale="vlocale">

            <a-image :width="200"
                     :style="{ display: 'none',zIndex:100 }"
                     :preview="{visible:PPEEquipmentPickupParams.previewShow.value,onVisibleChange:PPEEquipmentPickupParams.setVisible}" :src="PPEEquipmentPickupParams.imgUrl.value"></a-image>
            <m-pdf-pop-model></m-pdf-pop-model>
            <a-modal :destroy-on-close="true" v-model:open="PPEEquipmentPickupParams.popShow.value" ok-text="确定" :width="[0,1].includes(PPEEquipmentPickupParams.popType.value)?'70%':'30%'" height="800px" :title="{0:PPEEquipmentPickupParams.popTitle.value,1:PPEEquipmentPickupParams.popTitle.value,2:'发放信息'}[PPEEquipmentPickupParams.popType.value]" v-on:ok="PPEEquipmentPickupParams.handlePopOk">

                <a-spin :spinning="PPEEquipmentPickupParams.pagination.value.loading" tip="加载中，请耐心等待" />
                <div v-if="PPEEquipmentPickupParams.popType.value==0">
                    <a-form style="margin-top:20px"
                            layout="inline"
                            :model="PPEEquipmentPickupParams.GHForm.value">
                        <a-form-item label="单号：">

                            <a-input allow-clear placeholder="请填写单号" v-model:value="PPEEquipmentPickupParams.GHForm.value.FormNo"
                                     style="width:200px">
                            </a-input>

                        </a-form-item>
                        <a-form-item label="起止时间">
                            <a-range-picker v-model:value="PPEEquipmentPickupParams.GHForm.value.Time" />
                        </a-form-item>

                        <a-form-item>
                            <a-button v-on:click="PPEEquipmentPickupParams.handleSearch1" type="primary">查询</a-button>
                        </a-form-item>

                    </a-form>
                    <div class="title">领取记录</div>
                    <a-table :pagination="false" :data-source="PPEEquipmentPickupParams.GHDataSource.value" :columns="PPEEquipmentPickupParams.GHColumns.value">

                    </a-table>
                </div>

                <div v-if="PPEEquipmentPickupParams.popType.value==1">
                    <a-form style="margin-top:20px"
                            layout="inline"
                            placeholder="请填写工号"
                            :model="PPEEquipmentPickupParams.SHForm.value">
                        <a-form-item label="工号：">

                            <a-input allow-clear v-model:value="PPEEquipmentPickupParams.SHForm.value.UserNo"
                                     style="width:200px">
                            </a-input>

                        </a-form-item>
                        <a-form-item label="起止时间">
                            <a-range-picker v-model:value="PPEEquipmentPickupParams.SHForm.value.Time" />
                        </a-form-item>

                        <a-form-item>
                            <a-button v-on:click="PPEEquipmentPickupParams.handleSearch2" type="primary">查询</a-button>
                        </a-form-item>

                    </a-form>
                    <div class="title">发放记录</div>
                    <div style="max-height:700px;overflow-y:scroll">
                        <a-table :pagination="false" :data-source="PPEEquipmentPickupParams.SHDataSource.value" :columns="PPEEquipmentPickupParams.SHColumns.value">

                        </a-table>
                    </div>

                </div>




                <div style="height:450px;" v-else-if="PPEEquipmentPickupParams.popType.value==2">
                    <a-form style="margin-top:20px"
                            ref="sFormRule"
                            :rules="PPEEquipmentPickupParams.FormRule.value"
                            :model="PPEEquipmentPickupParams.SendForm.value">
                        <div style="display:flex;">

                            <a-form-item label="姓名：" required name="EmployeeName">

                                <a-input placeholder="请填写姓名" v-model:value="PPEEquipmentPickupParams.SendForm.value.EmployeeName"
                                         style="width:200px">
                                </a-input>

                            </a-form-item>


                            <a-form-item label="数量：" style="margin-left:40px" required name="Quantity">
                                <a-input-number placeholder="数量" id="inputNumber" v-model:value="PPEEquipmentPickupParams.SendForm.value.Quantity" :min="1" />
                            </a-form-item>


                        </div>

                        <a-form-item label="工号：" required name="EmployeeNo">

                            <a-input placeholder="请填写工号" v-model:value="PPEEquipmentPickupParams.SendForm.value.EmployeeNo"
                                     style="width:200px">
                            </a-input>

                        </a-form-item>





                        <a-form-item label="备注：">
                            <a-textarea style="width:400px" v-model:value="PPEEquipmentPickupParams.SendForm.value.Remark">
                            </a-textarea>
                        </a-form-item>

                    </a-form>

                    <div class="title">附件</div>
                    <div style="width:400px;max-height:200px;overflow-y:scroll">
                        <a-upload-dragger v-model:file-list="PPEEquipmentPickupParams.uploadImg.value.fileList"
                                          :item-render="PPEEquipmentPickupParams.itemRender.value"
                                          :custom-request="()=>{}"
                                          v-on:change="PPEEquipmentPickupParams.handleChange">

                            <p class="ant-upload-text">单击或拖动文件到此区域进行上传</p>
                            <p class="ant-upload-hint">
                                支持单个或批量上传
                            </p>
                        </a-upload-dragger>
                    </div>
                </div>

            </a-modal>
            <header class="px-5 box-border">
                <div class="flex items-center">
                    <div class="w-full h-[48px] text-[13px]  rounded-lg mx-auto my-[10px]  bg-white  text-[#888888] text-3xl flex items-center px-10">   <div class="w-22 h-22 bg-blue-200 mr-5"> <img class="w-full h-full cursor-pointer" v-on:click="PPEEquipmentPickupParams.vvback()" src="~/Assets/nimgs/exit.png" alt="返回" /></div> <span class="text-[]">信息门户<span class="mx-2">/</span>劳防用品<span class="mx-2">/</span><span class="text-[#424758] text-[15px]">用品发放</span> </span>  </div>
                </div>
                <a-spin :spinning="PPEEquipmentPickupParams.pagination.value.loading" tip="加载中，请耐心等待" />
                <a-tabs v-on:change="PPEEquipmentPickupParams.tchange" style="height:100%;width:100%;padding:0 30px;box-sizing:border-box" v-model:active-key="PPEEquipmentPickupParams.cIndex.value" class="w-full h-[48px] text-[13px] rounded-lg  bg-white">

                    <a-tab-pane v-for="(e,i) in PPEEquipmentPickupParams.tabList.value" :key="e.value" :tab="e.label">

                        <div class="w-full h-min-[108px] bg-white py-8">
                            <div class="mb-5 text-[16px] font-bold text-black">筛选条件</div>
                            <a-row>
                                <a-form layout="inline"
                                        :model="PPEEquipmentPickupParams.queryParams.value">

                                    <a-form-item label="劳防用品">
                                        <a-select placeholder="请选择劳防用品" allow-clear :filter-option="PPEEquipmentPickupParams.filterOption" :options="PPEEquipmentPickupParams.BasicList.value" show-search v-model:value="PPEEquipmentPickupParams.queryParams.value.BasicId"
                                                  style="width:180px">


                                        </a-select>
                                    </a-form-item>
                                    <a-form-item label="部门">
                                        <a-select :filter-option="PPEEquipmentPickupParams.filterOption" placeholder="请选择部门" allow-clear :options="PPEEquipmentPickupParams.deptList.value" show-search v-model:value="PPEEquipmentPickupParams.queryParams.value.DepartmentId"
                                                  style="width:180px">


                                        </a-select>
                                    </a-form-item>
                                    <a-form-item label="厂区">

                                        <a-select :filter-option="PPEEquipmentPickupParams.filterOption" allow-clear v-on:change="PPEEquipmentPickupParams.sChange" placeholder="请选择厂区" :options="PPEEquipmentPickupParams.areaList.value" show-search v-model:value="PPEEquipmentPickupParams.queryParams.value.FactoryAreaId"
                                                  style="width:180px">

                                        </a-select>
                                    </a-form-item>
                                    <a-form-item>
                                        <a-col><a-button v-on:click="PPEEquipmentPickupParams.getTableList(true)" type="primary">查询</a-button></a-col>
                                    </a-form-item>
                                </a-form>




                            </a-row>

                            <div class="flex w-full mt-10">
                                <a-card :bordered="true" class="w-full  mt-12">
                                    <template #title>
                                        <div class="w-full flex justify-between items-center">
                                            <div class="flex items-center"> <div>用品领取：</div> <div class="ml-7"><span style="color:#108ee9;font-size:20px">{{PPEEquipmentPickupParams.pagination.value.total}}</span></div></div>


                                        </div>
                                    </template>
                                    <a-table class="mt-0" :loading="PPEEquipmentPickupParams.pagination.value.loading" v-on:change="PPEEquipmentPickupParams.handleTableChange" :pagination="PPEEquipmentPickupParams.pagination.value" :data-source="PPEEquipmentPickupParams.dataSource1.value" :columns="PPEEquipmentPickupParams.columns1.value">

                                    </a-table>

                                </a-card>

                            </div>

                        </div>


                    </a-tab-pane>
                </a-tabs>
            </header>
        </a-config-provider>
    </a-style-provider>
</div>
@section Js{
    <script src="~/bussiness/js/base/tailwind.js"></script>
    <script type="module">
        import Composition from '../../bussiness/js/pg/PPE/EquipmentPickup.js?v=@DateTime.Now.ToString("yyyyMMddHHmm")'
        import localeValues from '../../Bussiness/js/base/es/locale/zh_CN.js'
        singalApp('PPEEquipmentPickup', Composition, localeValues)
    </script>
}
